package com.google.code.yargon;

import java.util.*;
import static com.google.code.yargon.engine.Item.typeOfItem.*;

import com.google.code.yargon.engine.*;

/**
 * @author Tuomas Oinonen
 */

public class ItemTest extends Item {

	public static void main(String[] args) {
		ItemStack reppu = new ItemStack();
		reppu.setName("Backpack");
		
		ItemStack pussi = new ItemStack();
		pussi.setName("Bag");

		ItemStack pouch = new ItemStack();
		pouch.setName("Pouch");

		Item ring = new Item();
		ring.setName("Ring Of Protection");
		ring.setType(RING);
		
		Item ring1 = new Item();
		ring1.setName("Ring Of steel");
		ring1.setType(RING);

		Item ring2 = new Item();
		ring2.setName("Gold ring");
		ring2.setType(RING);

		Item armor = new Item();
		armor.setName("Leather armor");
		armor.setType(ARMOR);

		Item armor1 = new Item();
		armor1.setName("Studded leather armor");
		armor1.setType(ARMOR);

		Item weapon = new Item();
		weapon.setName("Iron sword");
		weapon.setType(WEAPON);

		Item weapon1 = new Item();
		weapon1.setName("Steel sword");
		weapon1.setType(WEAPON);

		reppu.addToStack(ring);
		reppu.addToStack(weapon);
		reppu.addToStack(armor);
		
		pussi.addToStack(ring1);
		pussi.addToStack(weapon1);
		pussi.addToStack(armor1);
		
		pouch.addToStack(ring2);

		System.out.println("1. reppu:");
		reppu.listStack();
		System.out.println("1. pussi:");
		pussi.listStack();
		System.out.println("1. pouch:");
		pouch.listStack();
		
		reppu.changeByType(pussi, ARMOR);

		System.out.println("2. reppu:");
		reppu.listStack();
		System.out.println("2. pussi:");
		pussi.listStack();
		System.out.println("2. pouch:");
		pouch.listStack();
		
		pussi.changeByType(reppu, WEAPON);

		System.out.println("3. reppu:");
		reppu.listStack();
		System.out.println("3. pussi:");
		pussi.listStack();
		System.out.println("3. pouch:");
		pouch.listStack();

		reppu.changeByType(pouch, RING);
		pussi.changeByType(pouch, RING);

		System.out.println("4. reppu:");
		reppu.listStack();
		System.out.println("4. pussi:");
		pussi.listStack();
		System.out.println("4. pouch:");
		pouch.listStack();
		
		reppu.addToStack(pussi);
		System.out.println("5. reppu:");
		reppu.listStack();
		System.out.println("5. pussi:");
		pussi.listStack();
		System.out.println("5. pouch:");
		pouch.listStack();

	}

}
